<html>

<head>
    <title>Promise简单例子</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script type="text/javascript">
    function timeout(ms) {
        return new Promise((resolve, reject) => {
            console.log("promise");
            setTimeout(resolve, ms, 'done');
        });
    }

    timeout(100).then((value) => {
        console.log("value is" + value);
    });
    console.log("yo ho!");
    </script>
</head>

<body></body>

</html>
